/*
 * Copyright 2024 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.pajamas.protocol;

import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.util.Map;

/**
 * @author william
 * @since 2024/1/3
 */

public interface TreeFlatFormatter extends OverrideLess {
    /**
     * object -> flat map
     *
     * @param srcObj srcObj
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @author william
     * @since 2024/1/21
     */
    default Map<String, Object> format(Object srcObj) {
        this.unsupported();
        return null;
    }

    /**
     * text -> flat map
     *
     * @param text text
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @author william
     * @since 2024/1/21
     */
    default Map<String, Object> format(String text) {
        this.unsupported();
        return null;
    }

    /**
     * file -> flat map
     *
     * @param file file
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @author william
     * @since 2024/1/21
     */
    default Map<String, Object> format(File file) {
        this.unsupported();
        return null;
    }

    /**
     * input stream -> flat map
     *
     * @param inputStream inputStream
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @author william
     * @since 2024/1/21
     */
    default Map<String, Object> format(InputStream inputStream) {
        this.unsupported();
        return null;
    }

    /**
     * url -> flat map
     *
     * @param url url
     * @return java.util.Map<java.lang.String, java.lang.Object>
     * @author william
     * @since 2024/1/21
     */
    default Map<String, Object> format(URL url) {
        this.unsupported();
        return null;
    }
}
